<html>
<head><meta charset="utf-8"><title>toml, toml_edit, and cargo-add · t-cargo · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/index.html">t-cargo</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/toml.2C.20toml_edit.2C.20and.20cargo-add.html">toml, toml_edit, and cargo-add</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="248501862"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/toml%2C%20toml_edit%2C%20and%20cargo-add/near/248501862" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/toml.2C.20toml_edit.2C.20and.20cargo-add.html#248501862">(Aug 05 2021 at 16:32)</a>:</h4>
<p>I'd like to follow up from <a href="https://github.com/rust-lang/cargo/issues/5586">https://github.com/rust-lang/cargo/issues/5586</a> , because I think I'm not following the discussion on what the goals are.</p>



<a name="248501926"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/toml%2C%20toml_edit%2C%20and%20cargo-add/near/248501926" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/toml.2C.20toml_edit.2C.20and.20cargo-add.html#248501926">(Aug 05 2021 at 16:33)</a>:</h4>
<p>I understand that there was originally a proposed plan of factoring out a common lexer from toml and toml_edit, and then using both: toml in cargo, and toml_edit in cargo-edit.</p>



<a name="248502148"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/toml%2C%20toml_edit%2C%20and%20cargo-add/near/248502148" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/toml.2C.20toml_edit.2C.20and.20cargo-add.html#248502148">(Aug 05 2021 at 16:35)</a>:</h4>
<p>From what I can tell, <span class="user-mention" data-user-id="424212">@Ed Page</span> is proposing the alternate plan of improving toml_edit to the point that it can serve the function of toml, and then use toml_edit <em>as</em> the one toml library in Cargo. As far as I can tell, that would address all the requirements that were previously stated in that issue, and would result in Cargo only using one toml library (not just one lexer, one toml library).</p>



<a name="248502538"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/toml%2C%20toml_edit%2C%20and%20cargo-add/near/248502538" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/toml.2C.20toml_edit.2C.20and.20cargo-add.html#248502538">(Aug 05 2021 at 16:38)</a>:</h4>
<p>Assuming that toml_edit parses all of toml, and passes the testsuite, that seems to me like a reasonable approach to solve the problem.</p>



<a name="248502626"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/toml%2C%20toml_edit%2C%20and%20cargo-add/near/248502626" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/toml.2C.20toml_edit.2C.20and.20cargo-add.html#248502626">(Aug 05 2021 at 16:39)</a>:</h4>
<p><span class="user-mention" data-user-id="120518">@Eric Huss</span>, I think I'm not following your most recent comments on the issue, and I'd like to better understand your feedback on that proposed approach.</p>



<a name="248502816"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/toml%2C%20toml_edit%2C%20and%20cargo-add/near/248502816" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/toml.2C.20toml_edit.2C.20and.20cargo-add.html#248502816">(Aug 05 2021 at 16:41)</a>:</h4>
<p>It originally seemed like the primary requirement was to avoid having two toml parsers in Cargo, and I think that's exactly what motivated the proposed solution (fixing toml_edit so that it can do everything toml can).</p>



<a name="248533427"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/toml%2C%20toml_edit%2C%20and%20cargo-add/near/248533427" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/toml.2C.20toml_edit.2C.20and.20cargo-add.html#248533427">(Aug 05 2021 at 20:41)</a>:</h4>
<p>I guess I would need to see what that looks like. I'm a bit skeptical how it might work, since serde's model is so different.  I'm also a little uncomfortable taking on a new, large dependency that is a fundamental part of Cargo that we don't have direct control over.  We would also need to be careful about performance, since that is a problem we have today, and definitely don't want to make it worse.  I imagine also <span class="user-mention" data-user-id="116015">@Alex Crichton</span>  might have some thoughts.</p>



<a name="248534313"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/toml%2C%20toml_edit%2C%20and%20cargo-add/near/248534313" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/toml.2C.20toml_edit.2C.20and.20cargo-add.html#248534313">(Aug 05 2021 at 20:48)</a>:</h4>
<p>I'd basically just echo Eric, changing toml parsers is a really serious thing and would require a nontrivial amount of validation. Not only in terms of correctness but also speed as Eric mentioned.</p>



<a name="248534605"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/toml%2C%20toml_edit%2C%20and%20cargo-add/near/248534605" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ed Page <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/toml.2C.20toml_edit.2C.20and.20cargo-add.html#248534605">(Aug 05 2021 at 20:51)</a>:</h4>
<p>Can we define what our performance targets are for what use cases?</p>



<a name="248534912"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/toml%2C%20toml_edit%2C%20and%20cargo-add/near/248534912" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/toml.2C.20toml_edit.2C.20and.20cargo-add.html#248534912">(Aug 05 2021 at 20:54)</a>:</h4>
<p>I think at a bare minimum would be to be no worse than it is today.  Use cases would be everything cargo does (parsing Cargo.toml, Cargo.lock, cargo config, etc.).</p>



<a name="248535005"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/toml%2C%20toml_edit%2C%20and%20cargo-add/near/248535005" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/toml.2C.20toml_edit.2C.20and.20cargo-add.html#248535005">(Aug 05 2021 at 20:55)</a>:</h4>
<p>Ideally we'd be on a road to improve it.  That has been something I've been thinking of looking at sometime soon.</p>



<a name="248535041"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/toml%2C%20toml_edit%2C%20and%20cargo-add/near/248535041" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/toml.2C.20toml_edit.2C.20and.20cargo-add.html#248535041">(Aug 05 2021 at 20:55)</a>:</h4>
<p>AFAIK toml parsing is a relatively performance-critical operation since Cargo will parse the manifest of all your dependencies on all builds, which can sometimes reach hundreds of files not-really-all-that-small files. Measuring may not be the easiest but that's generally where the performance-sensitivity comes into play</p>



<a name="248535108"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/toml%2C%20toml_edit%2C%20and%20cargo-add/near/248535108" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/toml.2C.20toml_edit.2C.20and.20cargo-add.html#248535108">(Aug 05 2021 at 20:56)</a>:</h4>
<p>and yeah I would agree that toml parsing has shown up in profiles I've seen recently, so what we have already is by no means a "gold standard"</p>



<a name="248535181"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/toml%2C%20toml_edit%2C%20and%20cargo-add/near/248535181" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/toml.2C.20toml_edit.2C.20and.20cargo-add.html#248535181">(Aug 05 2021 at 20:56)</a>:</h4>
<p>I also know very little about toml-edit, so if it's already just like 10% slower that's fine, we can probably optimize it</p>



<a name="248535322"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/toml%2C%20toml_edit%2C%20and%20cargo-add/near/248535322" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ed Page <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/toml.2C.20toml_edit.2C.20and.20cargo-add.html#248535322">(Aug 05 2021 at 20:58)</a>:</h4>
<p>Thanks <span class="user-mention" data-user-id="116015">@Alex Crichton</span> for the use case of parsing an entire dependency of <code>Cargo.toml</code> files!</p>
<p>Do <code>Cargo.lock</code>s also show up?  Any suggested projects that would be good cases?</p>



<a name="248535821"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/toml%2C%20toml_edit%2C%20and%20cargo-add/near/248535821" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/toml.2C.20toml_edit.2C.20and.20cargo-add.html#248535821">(Aug 05 2021 at 21:00)</a>:</h4>
<p><code>Cargo.lock</code> is always rewritten in its entirety by cargo without preserving order or unknown fields.</p>



<a name="248535860"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/toml%2C%20toml_edit%2C%20and%20cargo-add/near/248535860" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ed Page <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/toml.2C.20toml_edit.2C.20and.20cargo-add.html#248535860">(Aug 05 2021 at 21:01)</a>:</h4>
<p>For parsing full dependency trees, I assume the registry is immutable.  Have we looked into doing one-time parsing and saving the result to a faster-to-parse format?  Seems like we'd hit a limit in improving parsing speeds with toml and bypassing toml would be the next step.</p>



<a name="248536420"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/toml%2C%20toml_edit%2C%20and%20cargo-add/near/248536420" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ed Page <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/toml.2C.20toml_edit.2C.20and.20cargo-add.html#248536420">(Aug 05 2021 at 21:04)</a>:</h4>
<p>Since there are unknowns to work out, I want to keep all options in mind.  I had a question on the original thread that hasn't been answered regarding our other options.  The suggestion for sharing was to share lexers for the sake of lower maintenance and consistent parsing behavior.  From my own parsing experience (though not toml), sharing lexers seems like there is only minimal sharing, that we still have to have a large surface area on top to maintain and keep consistent.  What is it I am missing?</p>



<a name="248537591"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/toml%2C%20toml_edit%2C%20and%20cargo-add/near/248537591" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ed Page <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/toml.2C.20toml_edit.2C.20and.20cargo-add.html#248537591">(Aug 05 2021 at 21:13)</a>:</h4>
<p><span class="user-mention" data-user-id="133247">@bjorn3</span> to be clear, I wasn't thinking we'd try to preserve format on <code>Cargo.lock</code> but was bringing it up for performance considerations if we had a <code>toml-rs</code> compatibility layer on top of <code>toml-edit</code> that was being used for <code>Cargo.lock</code></p>



<a name="248543565"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/toml%2C%20toml_edit%2C%20and%20cargo-add/near/248543565" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/toml.2C.20toml_edit.2C.20and.20cargo-add.html#248543565">(Aug 05 2021 at 22:06)</a>:</h4>
<p><span class="user-mention" data-user-id="424212">@Ed Page</span> <code>Cargo.lock</code> parsing does always happen but the performance is pretty inconsequential since it's just one file. It is sometimes thousands of lines so it shouldn't be <em>too</em> slow but making it 5x slower than what it is today probably wouldn't have any impact on perceived performance</p>



<a name="248543604"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/toml%2C%20toml_edit%2C%20and%20cargo-add/near/248543604" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ed Page <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/toml.2C.20toml_edit.2C.20and.20cargo-add.html#248543604">(Aug 05 2021 at 22:07)</a>:</h4>
<p>Thanks for clarifying!</p>



<a name="248543660"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/toml%2C%20toml_edit%2C%20and%20cargo-add/near/248543660" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/toml.2C.20toml_edit.2C.20and.20cargo-add.html#248543660">(Aug 05 2021 at 22:07)</a>:</h4>
<p>For the registry, we could do that (we actually do that for JSON blobs from the registry), but I think the optimization is a bit less applicable since we couldn't do similar caching for workspace path dependencies and projects sometimes have at least dozens of those (e.g. rustc itself), and that's a lot of TOML to still parse on each run</p>



<a name="248543779"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/toml%2C%20toml_edit%2C%20and%20cargo-add/near/248543779" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/toml.2C.20toml_edit.2C.20and.20cargo-add.html#248543779">(Aug 05 2021 at 22:09)</a>:</h4>
<p>From my perspective I found the lexing to be one of the trickier parts of the toml crate, and while I agree it still leaves out a lot it's at least <em>something</em> shared between the thing editing and the thing parsing. I  think ideally we'd use the exact same dependency, but I'm not sure if either toml or toml-edit is up for that task (I haven't looked very closely at toml-edit with an eye for this)</p>



<a name="248543896"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/toml%2C%20toml_edit%2C%20and%20cargo-add/near/248543896" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/toml.2C.20toml_edit.2C.20and.20cargo-add.html#248543896">(Aug 05 2021 at 22:10)</a>:</h4>
<p>I also want to be clear that these are hypothetical concerns about performance. It could be that switching to toml-edit has no measurable impact on performance. In that situation correctness would be paramount to verify (and I'm sure there's at least one bug in toml-rs that we've parsed bad TOML or something like that and we'd need a compatibility hack for)</p>



<a name="248543945"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/toml%2C%20toml_edit%2C%20and%20cargo-add/near/248543945" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/toml.2C.20toml_edit.2C.20and.20cargo-add.html#248543945">(Aug 05 2021 at 22:11)</a>:</h4>
<p>Cargo's handling of manifests is extremely far from optimal, there's tons of string clones and things like that IIRC, so it could be that toml parsing is a relatively small part of all this. Basically I'm saying that this should all be data-driven from real benchmarks with real profilers rather than purely from the gesticulations of us working on Cargo</p>



<a name="248543981"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/toml%2C%20toml_edit%2C%20and%20cargo-add/near/248543981" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/toml.2C.20toml_edit.2C.20and.20cargo-add.html#248543981">(Aug 05 2021 at 22:11)</a>:</h4>
<p>also, sorry if I'm slow to respond lol didn't see the ping here until just now</p>



<a name="248544185"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/toml%2C%20toml_edit%2C%20and%20cargo-add/near/248544185" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ed Page <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/toml.2C.20toml_edit.2C.20and.20cargo-add.html#248544185">(Aug 05 2021 at 22:13)</a>:</h4>
<p>Yeah, identifying a case to optimize and digging into the performance would be a fun project later down the road.  </p>
<p>Speaking of allocations, I imagine <code>smol_str</code> or <code>kstring</code>, with their small-string optimizations, would help <em>if</em> thats a problem.</p>



<a name="248544268"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/toml%2C%20toml_edit%2C%20and%20cargo-add/near/248544268" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ed Page <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/toml.2C.20toml_edit.2C.20and.20cargo-add.html#248544268">(Aug 05 2021 at 22:14)</a>:</h4>
<blockquote>
<p>From my perspective I found the lexing to be one of the trickier parts of the toml crate</p>
</blockquote>
<p>Oh interesting, I would not have expected that.  Good to know.</p>



<a name="248544540"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/toml%2C%20toml_edit%2C%20and%20cargo-add/near/248544540" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ed Page <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/toml.2C.20toml_edit.2C.20and.20cargo-add.html#248544540">(Aug 05 2021 at 22:17)</a>:</h4>
<p>Other future interests of mine for improving cargo is sharing definitions of messages between <code>cargo</code> and <code>cargo-metadata</code> / <code>escargot</code> and making it easier to share logic between <code>cargo</code> and external subcommands (e.g. get rid of the need for  duplicating logic in<code>clap-cargo</code>)</p>



<a name="248656742"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/toml%2C%20toml_edit%2C%20and%20cargo-add/near/248656742" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eh2406 <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/toml.2C.20toml_edit.2C.20and.20cargo-add.html#248656742">(Aug 06 2021 at 19:22)</a>:</h4>
<blockquote>
<p>I imagine <code>smol_str</code> or <code>kstring</code></p>
</blockquote>
<p>Cargo has an <code>InternedString</code> type that <em>may</em> be useful.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>